#include <allegro.h>

#include "propertytileset.hpp"
#include "tilelayer.hpp"

namespace nmc
{
	PropertyTileSet::PropertyTileSet()
	{
	}

	PropertyTileSet::~PropertyTileSet()
	{
	}

    void PropertyTileSet::drawTile(BITMAP *dest, int x, int y, int flags)
	{
		if (flags & TileLayer::SOLID)
		{
			rect(dest, x, y, x + 15, y + 15, makecol(0, 0, 0));
			rect(dest, x + 1, y + 1, x + 14, y + 14, makecol(255, 255, 255));
			rect(dest, x + 2, y + 2, x + 13, y + 13, makecol(0, 0, 0));
		}

		if (flags & TileLayer::PLATFORM)
		{
			rect(dest, x, y, x + 15, y + 3, makecol(0, 0, 0));
			hline(dest, x + 1, y + 1, x + 14, makecol(255, 255, 255));
		}

		if (flags & TileLayer::ICE)
		{
			rect(dest, x + 7, y + 3, x + 9, y + 12, makecol(0, 0, 0));
			vline(dest, x + 8, y + 4, y + 11, makecol(0, 255, 255));
		}
	}
}
